/*
 * StatC er SuperClassen som indholder "Main Metoder"
 */

package controller;

/**
 *
 * @author Reza Ayadi Panah
 */


public class StateC {

    private static StateC state;                
    private static UIC ui;                      //Kommunikation mellem UIC og StateC
    protected static int data;                  
    private static String display = "Display";      
    private static String control = "Control";
    protected static int money ;             //Startsværdi 0
    protected static long brew = 0;              //du skal endten vælge long() eller float (brew = brew_tiden)
    
    /**
     * starter states machine
     */
    protected static void start(UIC uiRef){
        money = 0;
        data = 0;
        ui = uiRef;                     // 
        state = new SelectDrink();      // Maskinen starter med at at være på SelectDring Tilstand
        ui.setState(state);             // kommuniker mmed UIC (set State())
        
    }
    
    /**
     * handlee events som er fokerte
     */
    protected void handle(String event, int data){          
        controlStr("Event " + event + " received in state " + state + " ignored.......... "); //This line is known as a statement.
        System.exit(0); 
    }
   
    
    /**
     *  Change State // Skifter stats
     */
    protected void changeState(StateC newState){
        state = newState;
        ui.setState(newState);        
    }
    
   
    
    
    /**
     * DisplayStr
     */
    protected static void displayStr(String str){
        String out = display + " " +  str;
        System.out.println(out);
    }
    
    
    /**
     * control Str   
     */
        protected static void controlStr(String str){    
        String out = control + " " + str;
        System.out.println(out);
    }
    
    public static int getPrice(){
    
    return money;
    
    }
    
    
}
